import request from '@/utils/request'

// 获取数据列表/查询
export function petList(data) {
  return request({
    url: `/owners/pet?current=${data.current}&pageSize=${data.pageSize}&adopt_time=${data.adopt_time}&name=${data.name}&community_code=${data.community_code}&building_code=${data.building_code}`,
    method: 'get'
  })
}

// 查询单个
export function getPet(id) {
  return request({
    url: `owners/pet/${id}`,
    method: 'GET'
  })
}
// 修改
export function editPet(data) {
  return request({
    url: `owners/pet/${data.id}`,
    method: 'PUT',
    data
  })
}

// 根据所属房产查询所属成员
export function houseMember(code) {
  return request({
    url: `/owners/member?house_code=${code}`,
    method: 'get'
  })
}
// 新增
export function addPet(data) {
  return request({
    url: 'owners/pet',
    method: 'POST',
    data
  })
}

// 删除
export function delPet(id) {
  return request({
    url: `owners/pet/${id}`,
    method: 'DELETE'
  })
}
